<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var day = 9;
        var month = 2;
        var hour = 16;
        var minute = 23;

        var date = {
            day,  // 等价于 day: day
            month, // 等价于 month: month
            hour, // 等价于 hour: hour
            minute, // 等价于 minute: minute
            week:'week',
        };

        // console.log(date);

        var person = {
            fn1(){
                console.log('fn1');
            }, // 如果fn1对应的是个函数 不能是箭头函数
            // 省略 function 和 :

            // 等同于 fn1:functuon(){}
            fn2:()=>{console.log('fn2')},
            fn3:function(){
                console.log('fn3')
            }
        }

        person.fn1();
        person.fn2();
        person.fn3()
        console.log(person)
    </script>
</body>
</html>